package model

import "RoccBlog/global"

type Role struct {
	Id          int          `json:"id" gorm:"primaryKey autoIncrement"`
	Name        string       `json:"name" gorm:"unique"`
	Code        string       `json:"code" gorm:"unique"`
	Permissions []Permission `json:"permissions" gorm:"many2many:role_permission"`
	Routers     []Router     `json:"routers" gorm:"many2many:role_router"`
	DbCaches    []DbCache    `json:"dbCaches" gorm:"many2many:role_db_cache"`
}

func init() {
	global.RegisterModel(&Role{})
}
